The computer graphics system displays the output of a computer in the form of figures.
The light source calculation in the shading processing in a conventional computer graphics system is detailed in .rho.OpenGL Programmnig Guide (Japanese version), published by Seiunsha, 1993, pp. 157-194.
The computer graphics system performs geometric processing and rendering processing. The geometric processing includes coordinate conversion of vertices of a figure and light source calculation to calculate colors of the vertices from information about, e.g., vertices of a figure, a light source, a viewing point position, colors and normal vectors, to see how the figure looks. The rendering processing involves developing and drawing pixels inside the figure one by one based on information about vertex coordinates and colors and so on. After the geometric processing and the rendering processing, the computer graphics system writes the contents to be displayed on the screen into a frame memory that stores data in a bit map format.
The computer graphics system generally represents pixel data by color data rgba (red, green, blue, alpha) of a figure, and performs the geometric processing in the float type and the rendering processing in the short-int type.
Here, the float type represents 32-bit floating point real numbers, the int type represents 32-bit integers (including fixed point real numbers), and the short int type represents 8- to 16-bit integers.
For the sake of simplicity, we assume that the short int type is 16-bit integers.
Now, let us explain about the computer graphics system whose color data of the pixel data in the frame memory are 8 bits (=1 byte) for each color component, or 32 bits in total.
The conventional light source computation calculates light source formulas such as Equation 4 in a float type which has large hardware quantities and is slow.
(Each component of rgb is calculated independently by Equation 4, and no calculation is performed on the component a. I.a=a).
[Equation 4] ##EQU1## where m is the number of light sources;
i (i=1 to m) is a light source; PA1 I=(I.r, I.g, I.b, I.a) is a color calculated by the light source computation; PA1 Ka=(Ka.r, Ka.g, Ka.b) is a ambient reflection coefficient of a material; PA1 Kd=(Kd.r, Kd.g, Kd.b) is a diffuse reflection coefficient of a material; PA1 Ks=(Ks.r, Ks.g, Ks.b) is a mirror surface reflection coefficient of a material; PA1 Ke=(Ke.r, Ke.g, Ke.b) is a radial reflection coefficient of a material; PA1 SM (0.0.ltoreq.SM.ltoreq.128.0) is a mirror surface index of a material; PA1 Lcta=(Lcta.r, Lcta.g, Lcta.b) is a color for each reflected light of an overall background light source; PA1 Lca.i=(Lca.r.i, Lca.g.i, Lca.b.i) is a color for background reflection light from a light source; PA1 Lcd.i=(Lcd.r.i, Lcd.g.i, Lcd.b.i) is a color for diffuse reflection light from a light source; PA1 Lcs.i=(Lcs.r.i, Lcs.g.i, Lcs.b.i) is a color for mirror surface reflection light from a light source; PA1 Normal vector N=(Nx, Ny, Nz); PA1 Light source direction vector L.i=(Lx.i, Ly.i, Lz.i); PA1 Halfway vector (maximum highlight direction vector) PA1 =1/(Kc+Kl.rho.d+Kq.rho.d 2): for point light sources and spot light sources PA1 where Kc, Kl, Kq are attenuation constants and d is the distance from the light source to the vertex. PA1 Sp.i=1: for parallel light sources and point light sources PA1 =(-SD.i.multidot.L.i) SE.i: within the illumination range of a spot light source (-SD.i.multidot.L.i).gtoreq.cos(SC.i) PA1 =0: Outside the illumination range of a spot light source (-SD.i.multidot.L.i)&lt;cos(SC.i) PA1 where SD.i=(SDx.i, SDy.i, SDz.i) is the spot light source direction vector; PA1 SE.i is the spot light index; and
H.i=(Hx.i, Hy.i, Hz.i), PA2 H.i=(V+L.i)/.rho.V+L.i.rho. where .rho.V+L.i.rho. is a magnitude of (V+L.i) sight direction vector V=(Vx, Vy, Vz) Each vector having a magnitude of 1.
It is assumed that (N.multidot.L.i)=0 when (N.multidot.L.i).gtoreq.0: (N.multidot.L.i)&lt;0.
It is also assumed that (N.multidot.H.i)=0 when (N.multidot.H.i).gtoreq.0: (N.multidot.H.i)&lt;0.
Further, it is assumed that (N.multidot.H.i)=0 also when (N.multidot.L.i).ltoreq.0.
Here, the attenuation coefficient At.i and the spot light source effect Sp.i are defined as follows.
At.i=1: for parallel light sources
SC.i is the cutoff index of a spot light source.
FIG. 6 shows the relation among the above vectors.
The conventional light source computation calculates these complex light source formulas in a float type that has large hardware quantities and is slow. Therefore, the light source computation requires a large quantity of float type calculations, and hence the conventional computer graphics systems use a geometry processor GP dedicated to the geometric processing to perform the light source computation by software. This requires a huge amount time for the light source computation.
The conventional computer graphics systems have a problem that although each component of the color data rgba in the frame memory are 8-bit data, the conventional light source computation requires performing a great amount of slow float type calculation (32 bits) containing many hardware quantities and spends a vast amount of time.